<template>
	<view>
		<!-- 轮播图 -->
		<u-swiper :list="detail.banners" height='200' indicator circular indicatorMode='dot'
			indicatorActiveColor='#f66'></u-swiper>
			
			<view class="">
				{{ detail.proname }}
			</view>
	</view>
</template>

<script>
	import {getProDetail} from '../../api/home.js'
	export default {
		data() {
			return {
				detail: {}
			}
		},
		methods: {
			
		},
		onLoad(options) {
			console.log(options.proid);
			const eventChannel = this.getOpenerEventChannel();
			// 监听proid事件，获取上一页面通过eventChannel传送到当前页面的数据
			  eventChannel.on('proid', function(data) {
			    console.log(data)
			  })
			  
			getProDetail(options.proid).then(res => {
				console.log(res);
				res.data.banners = res.data.banners[0].split(',')
				this.detail = res.data
			})  
		}
	}
</script>

<style>

</style>
